#include "SubmarineConfiguration.h"

SubmarineConfiguration::SubmarineConfiguration(int _numberConfiguration)
: numberConfiguration(_numberConfiguration){ }

SubmarineConfiguration::~SubmarineConfiguration() { }

SubmarineConfiguration* SubmarineConfiguration::createSubmarineConfiguration(int _type) throw (InvalidBoatConfiguration) {
	switch (_type) {
	case 1:
		return new SubmarineConfiguration1();
		break;
	case 2:
		return new SubmarineConfiguration2();
		break;
	default:
		throw InvalidBoatConfiguration(2);
	}
}

int SubmarineConfiguration::getNumberConfiguration() const {
	return numberConfiguration;
}

SubmarineConfiguration1::SubmarineConfiguration1() : SubmarineConfiguration(1){ }

SubmarineConfiguration1::~SubmarineConfiguration1() { }

RectangularBoatShape* SubmarineConfiguration1::getShape(const string& _name, const Point<int>& _origin, char _filledChar) const {
	return new RectangularBoatShape(_name, _origin, Dimension<int>(3,1), _filledChar);
}

SubmarineConfiguration2::SubmarineConfiguration2() : SubmarineConfiguration(2) { }

SubmarineConfiguration2::~SubmarineConfiguration2() { }

RectangularBoatShape* SubmarineConfiguration2::getShape(const string& _name, const Point<int>& _origin, char _filledChar) const {
	return new RectangularBoatShape(_name, _origin, Dimension<int>(1,3), _filledChar);
}
